<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_content
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

	// Get a db connection.
	$db = JFactory::getDbo();
	 
	// Create a new query object.
	$query = $db->getQuery(true);
	@$uid =  JRequest::getVar('id','');
	if(isset($uid)&&$uid!=0){
		// Select all records from the user profile table where key begins with "custom.".
		// Order it by the ordering field.
		$query->select('contact_name,contact_address,contact_city,contact_zip,contact_state,contact_phone,contact_fax,google_api,site_url');
		$query->from('#__user_profiles');
		$query->where('user_id='.$uid);
		// Reset the query using our newly populated query object.
		$db->setQuery($query);
		$results = $db->loadObjectList();
		foreach($results as $row){
			$contact_name 	   = $row -> contact_name;
			$contact_address 	= $row -> contact_address;
			$contact_city 	   = $row -> contact_city;
			$contact_zip 		= $row -> contact_zip;
			$contact_state 	  = $row -> contact_state;
			$contact_phone 	  = $row -> contact_phone;
			$contact_fax		= $row -> contact_fax;
			$googleapi		  = $row -> google_api;
			$siteurl 			= $row -> site_url;
		}
	}
?>
<div class="control-group">
     <label title="" class="hasTip control-label" for="jform_contact_contact_name" id="jform_contact_contact_name-lbl">Name</label>     
     <div class="controls">
     <input type="text" size="30" class="input-xlarge" value="<?php echo @$contact_name;?>" id="jform_contact_contact_name" name="jform[contact][contact_name]">     
     </div>
</div>
<div class="control-group">
     <label title="" class="hasTip control-label" for="jform_contact_contact_address" id="jform_contact_contact_address-lbl">Adress</label> 
     <div class="controls">
     <input type="text" size="30" class="input-xlarge" value="<?php echo @$contact_address;?>" id="jform_contact_contact_address" name="jform[contact][contact_address]">     
     </div>
</div>
<div class="control-group">
     <label title="" class="hasTip control-label" for="jform_contact_contact_city" id="jform_contact_contact_city-lbl">City</label>     
     <div class="controls">
     <input type="text" size="30" class="input-xlarge" value="<?php echo @$contact_city;?>" id="jform_contact_contact_city" name="jform[contact][contact_city]">     
     </div>
</div>
<div class="control-group">
     <label title="" class="hasTip control-label" for="jform_contact_contact_zip" id="jform_contact_contact_zip-lbl">Zip</label>     
     <div class="controls">
     <input type="text" size="30" class="input-xlarge" value="<?php echo @$contact_zip;?>" id="jform_contact_contact_zip" name="jform[contact][contact_zip]">     
     </div>
</div>
<div class="control-group">
     <label title="" class="hasTip control-label" for="jform_contact_contact_state" id="jform_contact_contact_state-lbl">State</label>     
     <div class="controls">
     <input type="text" size="30" class="input-xlarge" value="<?php echo @$contact_state;?>" id="jform_contact_contact_state" name="jform[contact][contact_state]">     
     </div>
</div>
<div class="control-group">
     <label title="" class="hasTip control-label" for="jform_contact_contact_phone" id="jform_contact_contact_phone-lbl">Phone</label>     
     <div class="controls">
     <input type="text" size="30" class="input-xlarge" value="<?php echo @$contact_phone;?>" id="jform_contact_contact_phone" name="jform[contact][contact_phone]">     
     </div>
</div>
<div class="control-group">
     <label title="" class="hasTip control-label" for="jform_contact_contact_fax" id="jform_contact_contact_fax-lbl">Fax</label>     
     <div class="controls">
     <input type="text" size="30" class="input-xlarge" value="<?php echo @$contact_fax;?>" id="jform_contact_contact_fax" name="jform[contact][contact_fax]">     
     </div>
</div>
<div class="control-group">
     <label title="" class="hasTip control-label" for="jform_contact_googleapi" id="jform_contact_googleapi-lbl">Google API</label>     
     <div class="controls">
     <input type="text" size="30" class="input-xlarge" value="<?php echo @$googleapi;?>" id="jform_contact_googleapi" name="jform[contact][googleapi]">     
     </div>
</div>
<div class="control-group">
     <label title="" class="hasTip control-label" for="jform_contact_siteurl" id="jform_contact_siteurl-lbl">Site URL</label>     
     <div class="controls">
     <input type="text" size="30" class="input-xlarge" value="<?php echo @$siteurl;?>" id="jform_contact_siteurl" name="jform[contact][siteurl]">     
     </div>
</div>
						            
